<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/>
    <script type="text/javascript" src="js/jquery-1.2.6.js"></script>
    <script type="text/javascript">
        document.write('<script type="text/javascript" src="js/'+getQueryStr("language")+'.js"><\/script>');
    </script>
    <link type="text/css" rel="stylesheet" href="style/style.css"/>
    <script type="text/javascript" src="plugin/artDialog.js?skin=green"></script>
    <title></title>
</head>
<body class="gui">

<div id="wrapper">
    <div id="content">
        <div id="header">
            <div id="logo">
                <h1>Control Panel</h1>
            </div>
        </div>
        <div id="main">
            <div id="contents_stat">
                <div id="homepage">
                <form name="filters" method="post">
                    <div class="frame_tab_layer">
                        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="cmenutitle">
                            <tr>
                                <!--<td  colspan="2"  class="frame_tab_right"><input type="image" src="images/homepic.png" onclick="javascript:openHelpWindow('ipadhelp.htm');"/><span style="padding-left:80px;"></span>-->
                                <!--<input type="image" src="images/phone.png"/>-->
                                <td colspan="2" align="center">
                                    <!--<div><input type="image" src="images/homepic.jpg"
                                                onclick="javascript:openHelpWindow('ipadhelp.htm');"/></div>-->
                                    <div><input type="image" src="images/homepic.jpg"/></div>
                                    <!--<div id="ipad"><input type="image" src="images/ipad.png"
                                                          onclick="javascript:openHelpWindow('ipadhelp.htm');"/></div>-->
                                    <div id="ipad"><input type="image" src="images/ipad.png"/></div>
                                    <div id="pstn">

                                        <label sid="guide.note23"></label>
                                    </div>
                                    <div id="phone">
                                        <label sid="guide.note24"></label>

                                    </div>
                                    <div id="ipadPhone">
                                        <label sid="guide.note25"></label>

                                    </div>
                                    <div id="pcPhone">
                                        <label sid="guide.note26"></label>
                                    </div>
                                    <div id="number1">
                                        <label sid="guide.note27"></label>
                                        6
                                    </div>
                                    <div id="number2">
                                        <label sid="guide.note27"></label>
                                        <span id="id401_0"></span>
                                    </div>
                                    <div id="number3">
                                        <label sid="guide.note27"></label>
                                        <span id="id401_1"></span>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div class="submitFooter">
                        <input class="button" type="button"  sid="guide.previous" name="previous" value="" />
                        <input class="button" type="button"  sid="guide.over" name="submit" value="" />
                        <input class="button" type="button"  sid="main.cancel" name="cancel" value="" />
                    </div>
                </form>
                </div>
                <div id="guideover" style="display: none;">
                    <form name="filters" method="post">
                        <fieldset>
                            <legend>
                                <label sid="guide.over2"></label>

                            </legend>
                            <div class="frame_tab_layer">
                                <table width="100%" border="0" cellpadding="0" cellspacing="0" class="cmenutitle">
                                    <tr>
                                        <td class="frame_tab_right">
                                            <img src="images/tick.png"/>
                                            <label sid="msg.guideSuccess1"></label>
                                            <label sid="msg.guideSuccess5"></label>
                                            <a href="index.htm">
                                                <label sid="msg.guideSuccess6"></label>
                                            </a>
                                            <label sid="msg.guideSuccess5_2"></label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" class="frame_tab_right">
                                            <span style="padding-left: 50px;"></span>
                                            <label sid="msg.guideSuccess2_part"></label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" class="frame_tab_right">
                                            <span style="padding-left: 50px;"></span>
                                            <label sid="msg.guideSuccess2"></label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" class="frame_tab_right">
                                            <span style="padding-left: 50px;"></span>
                                            <label sid="msg.guideSuccess3"></label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" class="frame_tab_right">
                                            <span style="padding-left: 50px;"></span>
                                            <label sid="msg.guideSuccess4"></label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" class="frame_tab_right">
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </fieldset>
                    </form>
                </div>
            </div>
        </div>

        <div id="floatKiller"></div>
        <div id="statusInfo">

            <div class="info"><span id="loginuser"></span></div>
            <!--<div class="info"><script type="text/javascript">Capture(share.logintime)</script><span id="uptime"></span></div>-->
            <div class="info">
                <button class="logout" onclick="reboot();"><img src="images/reboot.gif" border="0">&#160;
                    <label sid="tools.td10"></label>
                </button>
                <button class="logout" onclick="logout();"><img src="images/logout.gif" border="0">&#160;
                    <label sid="share.logout"></label>
                </button>
            </div>
        </div>

    </div>
</div>
<div id="lock_div">&nbsp; </div>
<div id="lock_div2">&nbsp;</div>
<div id="message_panel"><span id="mess">&nbsp;</span><br/>
    <br/>
    <img src="images/jd.gif"/>
</div>
<div id="rightMenu" style="display: none">
    <ul>
        <li id="editWords">Edit</li>
        <li id="defaultValue">Default</li>
    </ul>
</div>

<script type="text/javascript">
    setTimeout("height_div()", 500);
</script>
<script type="text/javascript" src="lib.js"></script>
<script type="text/javascript" src="js/message_panel.js"></script>
<script type="text/javascript">

    $("label").each(function () {
        var currentVal =$(this);
        var values =eval($(this).attr("sid"));
        if(typeof(values)!=="undefined"){
        $(this).html(decodeURIComponent(values));
        $(this).rightClick(function(){
            if(currentVal.attr("sid")) {
                showEditDialog(currentVal);
                currentVal.addClass("EditPosition");
            }
        });
        }
        if($(this).html()=="" && $(this).parent().hasClass("definition")){
            $(this).parent().hide();
            $(this).parent().prev().hide();
        }
    });

    $("input[type='button']").each(function () {
        $(this).val(decodeURIComponent(eval($(this).attr("sid"))));
        var currentButton =$(this);
        $(this).rightClick(function(){
            showEditDialog(currentButton,'val');
            currentButton.addClass("EditPosition");
        })


    });

    $("button").each(function(){
        var currentButton =$(this);
        var ButtonVal = currentButton.find("label");
        $(this).rightClick(function(){
            if(ButtonVal.attr("sid")) {
                showEditDialog(ButtonVal);
                ButtonVal.addClass("EditPosition");
            }
        })
    });




    var thisurl = document.URL;
    var oldsettext = thisurl.split("?")[1];
    var settext1 = oldsettext.substr(10, oldsettext.length);
    var setarray = settext1.split("&");
    var settext='';
    for(var i=0;i<setarray.length;i++){
        if(setarray[i].split("=")[0]!=="id401_0"&&setarray[i].split("=")[0]!=="id401_1"){
            settext+="&"+setarray[i];
        }
        if(setarray[i]=="line_id=5"){
           var id401_0 = setarray[i+1].split("=")[1];
        }else if(setarray[i]=="line_id=6"){
           var id401_1 = setarray[i+1].split("=")[1];
        }
    }
    $("#id401_0").html(id401_0);
    $("#id401_1").html(id401_1);

    $("[name=submit]").click(function () {
        deleteCookie("HomePhone");
        settext += "&id2010=1";
        var cannotModify = msg.cannotModify1;
        var noPower = msg.cannotModify2;
        var reboot = msg.submitSuccess;
        var cannotDelete = msg.cannotDelete;
        var cfgError = msg.cfgError;
        //show_message("pro", msg.saving);
        $.ajax({
            type:"POST", url:modules["set_data"], data:settext + "&tmp = " + Math.random(), timeout:1000, dataType:"xml", error:function (XMLHttpRequest, textStatus, errorThrown) {
                $("#homepage").slideUp();
                $("#guideover").slideDown();

            }, success:function (xml) {
                $(xml).find('rsp').each(function () {
                    $("#message_panel").fadeOut();
                    $("#lock_div").hide();
                    $("#lock_div2").hide();
                    $("#message_panel").hide();
                    var stat = $(this).attr('stat');
                    if (stat == "ok") {
                        //show_message("success",success);
                        alert(reboot);
                        $("#homepage").slideUp();
                        $("#guideover").slideDown();
                    } else if (stat == "restart" || stat == "reboot") {
                        //show_message("success",reboot);
                        alert(reboot);
                        $("#homepage").slideUp();
                        $("#guideover").slideDown();

                    } else if (stat == "fail") {
                        //show_message("err",msg.cfgError);
                        alert(msg.cfgError);
                        $(xml).find('Error').each(function () {
                            var code = $(this).attr('code');
                            if (code == 4) {
                                //show_message("err",cannotModify);
                                alert(cannotModify);
                            } else if (code == 5) {
                                gotologin();
                            } else {
                                if ($("[name = group]").attr("name")) {
                                    var str = '';
                                    $(xml).find('Error').each(function () {
                                        var code = $(this).attr('code');
                                        if (code == 4) {
                                            //show_message("err",cannotModify);
                                            alert(cannotModify);
                                        } else if (code == 5) {
                                            gotologin();
                                        } else {
                                            var strArray = $(this).attr('msg').split(" ");
                                            var mid = strArray[1].substr(2);
                                            str += mid + ",";
                                        }
                                    });
                                    //show_message("err",cannotDelete);
                                    alert(cannotDelete);
                                } else if ($("[name = tra-dis]").attr("name")) {
                                    //show_message("err",dialingRules.help5);
                                    alert(dialingRules.help5);
                                } else {
                                    var strArray = $(this).attr('msg').split(" ");
                                    var mid = strArray[1].substr(2);
                                    if (mid == 32 || mid == 31 || mid == 33 || mid == 34) {
                                        //show_message("err",cfgError);
                                        alert(cfgError);
                                    } else if ($(this).attr('msg').indexOf("line_id") >= 0) {
                                        var str1 = $(this).attr('msg').split(",");
                                        var str2 = str1[1].split(" ");
                                        var line_id = str2[1].split("=")[1];
                                        $("#msg" + mid + "_" + line_id).html('<img src="images/check_error.gif">');
                                    } else {
                                        showerror(mid);
                                    }
                                }
                            }
                        });
                    }
                });
            }
        });
        return true;
    });
    $("[name=previous]").click(function () {
        history.back();
    });

    $("[name=cancel]").click(function () {
        window.location.href="menuGuide.htm?language="+getQueryStr("language");
    });
</script>
</body>
</html>
